package com.platform.boot.security.user;

import org.springframework.data.r2dbc.repository.R2dbcRepository;
import reactor.core.publisher.Mono;

/**
 * @author Alex bob(<a href="https://github.com/vnobo">https://github.com/vnobo</a>)
 */
public interface UsersRepository extends R2dbcRepository<User, Long> {

    /**
     * get by username
     *
     * @param username user id
     * @return user model
     */
    Mono<User> findByUsernameIgnoreCase(String username);

    /**
     * get by code
     *
     * @param code user code
     * @return user model
     */
    Mono<User> findByCode(String code);

}